<?php
# -*- coding: utf-8 -*-
/**
 * Controller_Settings 博客设置
 *
 * @package Movoin Blog
 * @subpackage Admin
 *
 */

//{{include
FLEA::loadClass('Controller_Base');
//}}

class Controller_Settings extends Controller_Base
{

    /**
     * modelSettings 
     * 
     * @var mixed
     * @access public
     */
    var $modelSettings;

    /**
     * Controller_Settings 
     * 
     * @access public
     * @return void
     */
    function Controller_Settings()
    {
        // 构造父类
        parent::Controller_Base();
        $this->modelSettings = & FLEA::getSingleton('Model_Settings');
    }

    /**
     * actionIndex 
     * 
     * @access public
     * @return void
     */
    function actionIndex()
    {
        $settings = $this->modelSettings->getSettings();
        $this->_tpl->assign('settings',$settings);
        $this->_tpl->display('settings.tpl');
    }

    /**
     * actionHtml 
     * 
     * @access public
     * @return void
     */
    function actionHtml()
    {
        $this->_tpl->display('settings-html.tpl');
    }

    /**
     * actionFeeds 
     * 
     * @access public
     * @return void
     */
    function actionFeeds()
    {
        $this->_tpl->display('settings-feeds.tpl');
    }
    
    /**
     * actionUpdate 
     * 
     * @access public
     * @return void
     */
    function actionUpdate()
    {
        js_alert($this->modelSettings->update($_POST),0,url('settings'));
    }

}
